package fragment;

import android.app.Dialog;
import android.app.DialogFragment;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;

import com.example.administrator.projectmoudle_two.R;

/**
 * Created by eyesee on 2017/5/25.
 */

public class DialogFragmentView extends DialogFragment {

    private Dialog mDialog;

    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        mDialog = new Dialog(getActivity(),R.style.dialogTheme);

        View view = View.inflate(getActivity(), R.layout.dialogfragment, null);
        mDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
        mDialog.setContentView(view);
        mDialog.setCanceledOnTouchOutside(true);

        Window window = mDialog.getWindow();
        WindowManager.LayoutParams params = window.getAttributes();
        params.gravity = Gravity.START;
        params.width = 400;
        params.height = 1000;
        window.setAttributes(params);
        return mDialog;
    }
}
